﻿using Learun.Util;
using SqlSugar;
using System;
namespace Learun.Application.TwoDevelopment.ZZDT_EC

{
    /// <summary>
    /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
    /// Copyright (c) 2013-2018 Hexagon PPM
    /// 创 建：超级管理员
    /// 日 期：2022-06-21 15:32
    /// 描 述：接线模块 - panel柜子
    /// </summary>
    [SugarTable(TableName = "ec_Cable_Set_Wire")]
    public class ec_CableSetWireEntity
    {
        public ec_CableSetWireEntity()
        {
                
        }
        public ec_CableSetWireEntity(string setId)
        {
            Create();
            CableSetID = setId;
        }
        #region 实体成员
        /// <summary>
        /// ID
        /// </summary>
        /// <returns></returns>
        //public string CableID { get; set; } = "";
        /// <summary>
        /// CableSetID
        /// </summary>
        /// <returns></returns>
        public string CableSetID { get; set; } = "";
        /// <summary>
        /// WireID
        /// </summary>
        /// <returns></returns>
        [SugarColumn(IsPrimaryKey = true)]
        public string WireID { get; set; }
        /// <summary>
        /// Polarity
        /// </summary>
        /// <returns></returns>
        public string Polarity { get; set; } = "";
        /// <summary>
        /// SetLevel
        /// </summary>
        /// <returns></returns>
        public int SetLevel { get; set; }
        /// <summary>
        /// Wire_Tag
        /// </summary>
        /// <returns></returns>
        public string Wire_Tag { get; set; } = "";

        /// <summary>
        /// Wire_Color
        /// </summary>
        /// <returns></returns>
        public string Wire_Color_ID { get; set; } = "";
        /// <summary>
        /// 创建人
        /// </summary>
        /// <returns></returns>
        public string CreateUserID { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        /// <returns></returns>
        public DateTime? CreateTime { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        /// <returns></returns>
        public string UpdateUserID { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        /// <returns></returns>
        public DateTime? UpdateTime { get; set; }
        #endregion

        #region 扩展操作
        /// <summary>
        /// 新增调用
        /// </summary>
        public void Create()
        {
            this.WireID = Guid.NewGuid().ToString();
            this.CreateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.CreateUserID = userInfo.userId;


        }
        /// <summary>
        /// 编辑调用
        /// </summary>
        /// <param name="keyValue"></param>
        public void Modify(string keyValue)
        {
            this.WireID = keyValue;
            this.UpdateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.UpdateUserID = userInfo.userId;
        }
        #endregion

        #region 扩展字段
        /// <summary>
        /// 删除标记
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public bool DeleteFlg { set; get; } = false;

        /// <summary>
        /// 电缆左侧
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public ec_WireTerminalEntity ConnectionOnSide1 { get; set; }

        /// <summary>
        /// 电缆右侧
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public ec_WireTerminalEntity ConnectionOnSide2 { get; set; }
        #endregion
    }
}

